//
//  MZExhibitionRoomViewController.m
//  民族文化宫
//
//  Created by WANG CUNRUI on 14-5-24.
//  Copyright (c) 2014年 WANG CUNRUI. All rights reserved.
//

#import "MZExhibitionRoomViewController.h"

@interface MZExhibitionRoomViewController ()
@property UILabel *imglabel;
@end

@implementation MZExhibitionRoomViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    CGRect frame = self.view.bounds;
    CGSize f = frame.size;
    CGFloat h = f.height;
//    CGFloat w = f.width;
    //    _scrollView =[[UIScrollView alloc]initWithFrame:CGRectMake(0,0,350,456)];
    self.view.backgroundColor = [UIColor  colorWithRed:0.9373 green:0.9216 blue:0.9059 alpha:1.0];


    _imglabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0.053*h, 300, 0.32*h)];
    _imglabel.layer.borderWidth = 0.5;
    _imglabel.layer.cornerRadius = 8;
    _imglabel.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    [_imglabel setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.3]];
    [self.view addSubview:_imglabel];
    
    UIImageView *mapImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room.png"]];
    mapImage.frame = CGRectMake(10,0.02*h,280,0.3*h);
    [_imglabel addSubview:mapImage];
    
    
    _button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button1.frame = CGRectMake(10, 0.44*h, 300, 40);
    _button1.layer.cornerRadius = 8;
    [_button1 setTitle:@"展厅一楼" forState:UIControlStateNormal];
    [_button1 setImage:[UIImage imageNamed:@"map.png"] forState:UIControlStateNormal];
    
    [_button1 setImageEdgeInsets:UIEdgeInsetsMake(5, 10, 0, 250)];
    [_button1 setTitleEdgeInsets:UIEdgeInsetsMake(0, -250, 0, 00)];
    [_button1 setBackgroundColor:[UIColor whiteColor]];
    [_button1 setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
    _button1.titleLabel.font = [UIFont systemFontOfSize:13];
    [_button1 addTarget:self action:@selector(butClick:) forControlEvents:UIControlEventTouchUpInside];
    _button1.tag = 1;
    [self.view addSubview:_button1];
    UIImageView *mapImage1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ic_arrow.png"]];
    mapImage1.frame = CGRectMake(275,10,20,20);
    [_button1 addSubview:mapImage1];
    _button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button2.frame = CGRectMake(10, 0.55*h, 300, 40);
    _button2.layer.cornerRadius = 8;
    [_button2 setTitle:@"展厅二楼" forState:UIControlStateNormal];
    [_button2 setImage:[UIImage imageNamed:@"map.png"] forState:UIControlStateNormal];
    [_button2 setImageEdgeInsets:UIEdgeInsetsMake(5, 10, 0, 250)];
    [_button2 setTitleEdgeInsets:UIEdgeInsetsMake(0, -250, 0, 00)];
    [_button2 setBackgroundColor:[UIColor whiteColor]];
    [_button2 setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
    _button2.titleLabel.font = [UIFont systemFontOfSize:13];
    [_button2 addTarget:self action:@selector(butClick:) forControlEvents:UIControlEventTouchUpInside];
    _button2.tag = 2;
    [self.view addSubview:_button2];
    UIImageView *mapImage2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ic_arrow.png"]];
    mapImage2.frame = CGRectMake(275,10,20,20);
    [_button2 addSubview:mapImage2];
    _button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button3.frame = CGRectMake(10, 0.66*h, 300, 40);
    _button3.layer.cornerRadius = 8;
    [_button3 setTitle:@"展厅三楼" forState:UIControlStateNormal];
    [_button3 setImage:[UIImage imageNamed:@"map.png"] forState:UIControlStateNormal];
    [_button3 setImageEdgeInsets:UIEdgeInsetsMake(5, 10, 0, 250)];
    [_button3 setTitleEdgeInsets:UIEdgeInsetsMake(0, -250, 0, 00)];
    [_button3 setBackgroundColor:[UIColor whiteColor]];
    [_button3 setTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
    _button3.titleLabel.font = [UIFont systemFontOfSize:13];
    [_button3 addTarget:self action:@selector(butClick:) forControlEvents:UIControlEventTouchUpInside];
    _button3.tag = 3;
    [self.view addSubview:_button3];
    UIImageView *mapImage3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ic_arrow.png"]];
    mapImage3.frame = CGRectMake(275,10,20,20);
    [_button3 addSubview:mapImage3];

    
    // Do any additional setup after loading the view.
}

- (void)butClick:(UIButton *)but
{
//    if (but.tag == 1) {
//        _YiLouController = [[YiLouController alloc] init];
//        [self.navigationController pushViewController:_YiLouController animated:YES];
//    } else if(but.tag == 2) {
//        _ErLouController = [[ErLouController alloc] init];
//        [self.navigationController pushViewController:_ErLouController animated:YES];
//    }else if(but.tag == 3)
//    {
//        _SanLouController = [[SanLouController alloc] init];
//        [self.navigationController pushViewController:_SanLouController animated:YES];
//    }else
//    {
//        NSLog(@"error");
//    }
    _SanLouController = [[SanLouController alloc] init];
    [self.navigationController pushViewController:_SanLouController animated:YES];
    }

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
